/*
 * @Author: kanglang
 * @Date: 2020-11-23 11:38:07
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-07-22 14:54:04
 * @Description: 三方登录方式
 */
import React from 'react';
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { px2dp } from '@/styles';
import { WXLogin } from '@/common/wx-login';
import { wechat } from '@/images';
import AgreementBox from './agreement-box';

const OtherWay = ({ loginResult, articlesList, showState }) => {
  return (
    <View style={styles.container}>
      {/* {
        showState !== 1 && (
          <>
            <View style={styles.ortherLine}>
              <Text style={styles.line} />
              <Text style={styles.lineText}>其它登录方式</Text>
              <Text style={styles.line} />
            </View>
            <View style={styles.loginTheWay}>
              <TouchableOpacity
                style={{ paddingHorizontal: px2dp(10) }}
                onPress={() => {
                  WXLogin((isSuccess) => {
                    loginResult && loginResult(isSuccess);
                  });
                }}
              >
                <Image
                  style={styles.weixin}
                  source={wechat}
                />
              </TouchableOpacity>
            </View>
          </>
        )
      } */}
      <View style={{ marginTop: px2dp(48) }}>
        <AgreementBox
          articlesList={articlesList}
          textStyle={{ textAlign: 'center' }}
        />
      </View>
    </View>
  );
};

export default OtherWay;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    marginTop: px2dp(40),
  },
  ortherLine: {
    flexDirection: 'row',
    alignItems: 'center',
    color: '#999796',
  },
  line: {
    height: px2dp(1),
    width: '33%',
    backgroundColor: '#CCCAC8'
  },
  lineText: {
    color: '#999796',
    fontSize: px2dp(28)
  },
  loginTheWay: {
    flexDirection: 'row',
    // 设置次轴的对齐方式
    alignItems: 'center',
    justifyContent: 'flex-start',
    // 绝对定位
    // position: 'absolute',
    // 距离底部还有30 距离左边还有10 这样的一个位置
    // bottom: px2dp(160),
    marginTop: px2dp(40),
    color: '#999796'
  },
  weixin: {
    width: 36,
    height: 36
  },
  agreementBox: {
    flexDirection: 'row',
    color: '#999796',
    marginLeft: px2dp(46 * 2),
    marginRight: px2dp(68 * 2),
  },
  text1: {
    color: '#666564',
    fontSize: px2dp(24),
    lineHeight: px2dp(36),
  },
  text2: {
    color: '#BA914A',
    fontSize: px2dp(24)
  },
  check: {
    width: px2dp(32),
    height: px2dp(32),
    top: px2dp(4),
    marginRight: px2dp(10)
  },
});
